[6.0] Extend versioning, save releated information in history table and restore historical data#45515
[6.0] Extend versioning, save releated information in history table and restore historical data#45515softforge merged 36 commits intojoomla:6.0-devfrom
Conversation
Co-authored-by: Brian Teeman <brian@teeman.net>
Co-authored-by: Brian Teeman <brian@teeman.net>
|
I have tested this item ✅ successfully on eb8533b B.t.w. This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/45515. |
1 similar comment
|
I have tested this item ✅ successfully on eb8533b B.t.w. This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/45515. |
|
I now know why the tests are failing, when creating a banner over the api only the table class is used and not the model. So the problem is "only" an API problem. |
|
I also got the |
|
@rdeutz - there are some issues with this PR ;( Sometimes it restores with a blank article, sometimes not, (no error message), Tags not restored :/ (sorry) |
@rdeutz Then the failing API test should be commented out with a to do comment so that system tests are passing. Merging this PR as it is would mean to break system tests in the 6.0-dev branch. |
|
I have tested this item ✅ successfully on c027b4d This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/45515. |
|
When you restore to the initial version the buttons disappear AND you cannot save the article See video chrome_0NbUOiTwTM.mp4 |
|
I have tested this item 🔴 unsuccessfully on c027b4d This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/45515. |
Co-authored-by: Martina Scholz <64533137+LadySolveig@users.noreply.github.com>
|
Thank you to @rdeutz for his work on this and to @LadySolveig and @richard67 for the work they did fixing this to the point we could merge. Thank you to all the testers and also for the work done by @brianteeman to make sure deficiencies were noted and documented so we have a clear measure of what must be done to get this ready before RC |
|
I have tested this item 🔴 unsuccessfully on c027b4d This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/45515. |
|
@heelc29 Could you open a new issue with your findings? Maybe @brianteeman could then add his findings, too. |
|
Thank you all for testing and pointing out the issues. I know there are still issues and I will do my best to fix them asap. |
|
At the bottom of the Preview of Version form there is a |



Our versioning works on databse table level, this leads to situations that we save an article with custom fields but the CF are not included in the history. This is unexpected from a user perspective. This PR starts to change this behaviour so that releated information are also saved.
Summary of Changes
I have added an interface VersionableModelInterface, if a model implements this interface then in AdminModel the save of the histroy data is done in the save method (calls saveHistory) of the Model. This is the first step and we have now the data with releated information in the history table.
If you want to restore a version then in loadHistory (VersionableModelTrait) set the data from the history table as session data and loadForm use this data when you edit an item.
It works for CF so far. At the moment not for Tags (tags is a pain, we might change more on tags for 6 so I haven't looked into the details why not).
This is a b/c break and I don't know how many are affected but I think that it can't be too much hassle and what we get when we finish this is worth the work for extensions developers.
Testing Instructions
It is now done for all core extensions and item whitch supports versions
Actual result BEFORE applying this Pull Request
Custom fields have always the last saved value
Expected result AFTER applying this Pull Request
Custom fields have the value from the saved version, Tags get restored
Link to documentations
Documentation will be provided at a later stage.
Please select:
Documentation link for docs.joomla.org:
No documentation changes for docs.joomla.org needed
Pull Request link for manual.joomla.org:
No documentation changes for manual.joomla.org needed